<?php 

// $search = 'RA≥71 / RA≥90厘米 (切入高显指滤光片)';
// $search = '61颗;（3000K暖白34颗,6000K冷白27颗）';
// $search = '你好 MSD 280W';
// $search = '欧司朗@371W';
// $search = '2-60°，Φ140mm前端镜';
$search = '46000 @10米';
// $search = 'Beem模式2-21°，Spot模式3-42°';
// $search = '2800K~10000K线性调节';
// $search = 'OSRAM Lok-it® 1400/PS Brilliant';
// $search = '防水等级：IP20';
// $search = '频率响应：58Hz-18kHz;±3dB（-10dB@46Hz）';
// $search = '输出功率：： 4Ω 4 x 950W ,8Ω 4x650W;或者 70V 直驱';
// $search = '最大输出耗粉末量：约 66 g/min';
// $search = str_replace(['(', ')', '（', '）'], ['','','',''], $search);

$needfenci = 0;
$res = [];
$fenhao = explode('；', $search);
$fenhaoEn = explode(';', $search);
$douhao = explode('，', $search);
$douhaoEn = explode(',', $search);
if (!$res && count($fenhao) > 1) {
	$res = $fenhao;
}
if (!$res && count($fenhaoEn) > 1) {
	$res = $fenhaoEn;
}
if (!$res && count($douhao) > 1) {
	$res = $douhao;
}
if (!$res && count($douhaoEn) > 1) {
	$res = $douhaoEn;
}

// $res = [];
if (!$res) {
	// 正则
	// $pattern = '/[A-Za-z0-9\s\/\(\)\≥\≤\-\+＝\.\']+/';
	$pattern = '/([\w\s≥\-\/~@®°Φ±颗斤米厘米顿秒]+)/u';
	preg_match_all($pattern, $search, $matches);
	// var_dump($matches);die;

	if (count($matches[0]) == 1) {
		$search2 = $matches[0][0];
		// $search2 = '2800K~10000K线性调节11100k你好';
		// $search2 = '线性调节111你好';

		// var_dump($search2);die;
		// 全中文走分词
		// $patternAllZh = '/([\x{4e00}-\x{9fa5}]+)/u';
		$patternAllZh = '/^[\x{4e00}-\x{9fa5}]+&/u';
		// preg_match_all($patternAllZh, $search2, $matchesZh);

		// foreach($matchesZh[0] as $v) {
		// 	if (in_array($v, $liangciArr)) {
		// 		// todo 过滤量词 
		// 	}
		// }

		// var_dump(preg_match($patternAllZh, $search2));die;
		if (!preg_match($patternAllZh, $search2)) {
			$pattern2 = '/([\x{4e00}-\x{9fa5}]+)/u';
			preg_match_all($pattern2, $search2, $matches2);
			$res3 = str_replace($matches2[0], '====', $search2);
			// var_dump($matches2, $res3);die;

			$res4 = explode('====', $res3 );

			$res4 = array_filter($res4);

			$res4 = array_merge($res4,  $matches2[0]);

			if (count($res4) > 1) {
				foreach ($res4 as $key => $value) {
					$res4[$key] = trim($value);
				}
				$res = $res4;
			} else {
				$res = $search2;
			}
		} else {
			$needfenci = 1;
		}
		
	} else {
		$res = $matches[0];
	}
}

var_dump($res, $needfenci);die;